/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "MashStep")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MashStep.findAll", query = "SELECT m FROM MashStep m"),
    @NamedQuery(name = "MashStep.findByStepID", query = "SELECT m FROM MashStep m WHERE m.stepID = :stepID"),
    @NamedQuery(name = "MashStep.findByMashType", query = "SELECT m FROM MashStep m WHERE m.mashType = :mashType"),
    @NamedQuery(name = "MashStep.findByTemperature", query = "SELECT m FROM MashStep m WHERE m.temperature = :temperature"),
    @NamedQuery(name = "MashStep.findByRatio", query = "SELECT m FROM MashStep m WHERE m.ratio = :ratio"),
    @NamedQuery(name = "MashStep.findByMinutes", query = "SELECT m FROM MashStep m WHERE m.minutes = :minutes")})
public class MashStep implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "stepID")
    private Integer stepID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "mashType")
    private int mashType;
    @Basic(optional = false)
    @NotNull
    @Column(name = "temperature")
    private float temperature;
    @Column(name = "ratio")
    private Float ratio;
    @Basic(optional = false)
    @NotNull
    @Column(name = "minutes")
    private int minutes;

    public MashStep() {
    }

    public MashStep(Integer stepID) {
        this.stepID = stepID;
    }

    public MashStep(Integer stepID, int mashType, float temperature, int minutes) {
        this.stepID = stepID;
        this.mashType = mashType;
        this.temperature = temperature;
        this.minutes = minutes;
    }

    public Integer getStepID() {
        return stepID;
    }

    public void setStepID(Integer stepID) {
        this.stepID = stepID;
    }

    public int getMashType() {
        return mashType;
    }

    public void setMashType(int mashType) {
        this.mashType = mashType;
    }

    public float getTemperature() {
        return temperature;
    }

    public void setTemperature(float temperature) {
        this.temperature = temperature;
    }

    public Float getRatio() {
        return ratio;
    }

    public void setRatio(Float ratio) {
        this.ratio = ratio;
    }

    public int getMinutes() {
        return minutes;
    }

    public void setMinutes(int minutes) {
        this.minutes = minutes;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (stepID != null ? stepID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MashStep)) {
            return false;
        }
        MashStep other = (MashStep) object;
        if ((this.stepID == null && other.stepID != null) || (this.stepID != null && !this.stepID.equals(other.stepID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.MashStep[ stepID=" + stepID + " ]";
    }
    
}
